/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.core.tabbedproperties;

import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.eclipse.uml2.uml.ConnectionPointReference;
import org.eclipse.uml2.uml.FinalState;
import org.eclipse.uml2.uml.Pseudostate;

import com.cea.papyrus.core.editpart.GraphEdgeEditPart;
import com.cea.papyrus.core.editpart.GraphNodeEditPart;

/**
 * This class is filter to display element in the appearance section
 */
public class AppearenceSectionFilter extends UMLElementFilter {

   /**
    * {@inheritDoc}
    */
    public boolean select(Object object) {

        if (!(object instanceof AbstractGraphicalEditPart) || !super.select(object)) {
            return false;
        }
        
        if (! (object instanceof GraphNodeEditPart)
        		&& ! (object instanceof GraphEdgeEditPart)) {
        	return false;
        }
        
        if ((element instanceof Pseudostate)
        	|| (element instanceof FinalState)
        	|| (element instanceof ConnectionPointReference)) {
        		
        	return false;
        }
        
        return true;
    }

}
